package com.rmt.controller;

import com.rmt.pojo.zy_news;

import com.rmt.service.impl.Zynewsserviceimpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author ruoyunzifan
 * @create 2019-12-18 11:33
 */
@Controller
public class Zynewscontroller {
    @Autowired
    private Zynewsserviceimpl ceshi2;

    @RequestMapping(value = "/all",method = RequestMethod.GET)
    @ResponseBody
    public List<zy_news> test(){
        return ceshi2.findbyid();
    }
    @RequestMapping(value="delete",method = RequestMethod.GET)
    @ResponseBody
    public List<zy_news> test1(String title){
        return ceshi2.findByTitle(title);
    }
}
